<html><head>
<script language="Javascript" src="../gamelib/gamelib_core.js"></script>
<script language="Javascript">

var t0=null;	// used for the interval timer...
var pos=0;	// position in circle (degree if you like ;)

function init(){
	mylayer=new Gl_layer(100,100,200,"TESTING SINE");	// create a layer to use
	t0=setInterval("circle()",50)				// start the circle motion
}

function circle(){

				// move layer in circle, of radius 80 pixels in each axis
				// Here, we use sine for x axis, and cosine for y axis
				// We add 100 to each, to keep it in view at all times

	mylayer.moveTo(100+(Gl_sin[pos]*80),100+(Gl_cos[pos]*80));

	pos+=2;			// move 2 degrees round at a time...

	if(pos>359) pos-=360;	// stop pos going over 359 degrees!
				// When it does, subtract 360 from it, to bring it back
				// into range (0-359)
}

</script>
</head><body onload="init()"></body></html>